Add choropleth support to GeoAxes#623
Merged
cvanelteren merged 9 commits intoUltraplot:mainfrom Mar 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a first-class GeoAxes.choropleth API for coloring polygon geometries (including country-keyed inputs) and integrates it with UltraPlot’s colormap/colorbar pipeline, along with docs examples and geographic tests (closes #622).
Changes:
- Implement
GeoAxes.choropleth()plus supporting geometry projection/path helpers inultraplot/axes/geo.py. - Add targeted choropleth tests for collections, missing-value styling, country resolution, zorder, and validation errors.
- Add documentation examples demonstrating polygon- and country-based choropleths.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ultraplot/axes/geo.py |
Introduces GeoAxes.choropleth() and helper utilities for projecting shapely polygon rings into backend coordinates and producing PatchCollections. |
ultraplot/tests/test_geographic.py |
Adds unit tests covering choropleth rendering behavior, country-identifier resolution, zorder defaults, and input validation. |
docs/projections.py |
Adds a new projections guide snippet demonstrating polygon choropleth usage with colorbar formatting. |
docs/examples/geo/04_choropleth.py |
Adds a standalone documentation example for country-keyed choropleths with missing-value styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Collaborator
|
From the example, the |
Collaborator
Author
|
That is a z-order issue let me fix that. The choropleth shapes are drawn on top of the existing geometries. |
Collaborator
Author
gepcel
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add a first-class GeoAxes.choropleth API for polygon geometries and country-keyed values, including colorbar integration, missing-value styling, documentation examples, and targeted geographic tests. Closes #622.